package com.ssy.lingxi.report.entity.report;

import com.ssy.lingxi.report.handler.convert.JpaJsonToMemberTallyReportBOConverter;
import com.ssy.lingxi.report.model.bo.MemberTallyReportBO;

import javax.persistence.*;
import java.io.Serializable;

/**
 * 会员计数报表
 * @author 伍将
 * @date 2020/11/20
 * @version 2.0.0
 */
@Entity
@Table(schema = "public", name = "rep_member_tally_report",indexes = {@Index(name = "rep_member_tally_report_idx", columnList = "memberId,roleId",unique = true)})
public class MemberTallyReportDO implements Serializable {

    private static final long serialVersionUID = -2775288470328416395L;
    /**
     * id
     */
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "member_tally_report_seq")
    @SequenceGenerator(sequenceName = "rep_member_tally_report_seq", name = "member_tally_report_seq", allocationSize = 1)
    private Long id;

    /**
     * 会员id
     */
    @Column(columnDefinition = "int8")
    private Long memberId;

    /**
     * 角色id
     */
    @Column(columnDefinition = "int8")
    private Long roleId;

    /**
     * 计数报表
     */
    @Convert(converter = JpaJsonToMemberTallyReportBOConverter.class)
    @Column(columnDefinition = "jsonb")
    private MemberTallyReportBO TallyReport;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getMemberId() {
        return memberId;
    }

    public void setMemberId(Long memberId) {
        this.memberId = memberId;
    }

    public Long getRoleId() {
        return roleId;
    }

    public void setRoleId(Long roleId) {
        this.roleId = roleId;
    }

    public MemberTallyReportBO getTallyReport() {
        return TallyReport;
    }

    public void setTallyReport(MemberTallyReportBO tallyReport) {
        TallyReport = tallyReport;
    }
}
